import base from './base'
//import axios from '@/request/index.js'
import axios from 'axios'
const api = {
   // 首页顶部数据统计
   getHomeCount(){
     return axios.get(base.homeCount)
   },
   // 首页图表绘制
   getHomeFormat(){
     return axios.get(base.homeFormat)
   },
   // 订单信息
   getHomeOrder(){
    return axios.get(base.homeOrder)
   },
   // 产品列表
   getGoodsList(params){
     return axios.get(base.goodsList,{params})
   },
   // 产品查询
   getGoodsSearch(params){
     return axios.get(base.goodsSearch,{params})
   },
   // 删除商品
   getDeleteGoods(params){
     return axios.get(base.deleteGoods,{params})
   },
   // 
   getGoodsItemCategory(){
     return axios.get(base.goodsItemCategory)
   },
   
   // 批量删除
   batchDelte(params){
      return axios.get(base.batchDelte,{params})
   },
   // 修改商品
   updateTbItem(params){
     return axios.get(base.updateTbItem,{params})
   },
   
   // 增加一级类目  {name}
   insertCategory(params){
      return axios.get(base.insertCategory,{params})
   },
   // 增加子级类目  params = { cid,name}
   insertItemCategory(params){
     return axios.get(base.insertItemCategory,{params})
   },
   // 修改类目  {id,name}
   updateCategory(params){
    return axios.get(base.updateCategory,{params})
   },
   // 删除类目  {id}
   deleteContentCategoryById(params){
     return axios.get(base.deleteContentCategoryById,{params})
   },
  
   // 订单列表
   /* 
   orderList(params){
    return axios.get(base.orderList,{params})
   }, */

   orderList(){
    return axios.get(base.orderList)
   },


   // 订单汇总  ids
   /* 
   changeStatus(params){
    return axios.get(base.changeStatus,{params})
   },*/

   changeStatus(){
      return axios.get(base.changeStatus)
   },

   // 汇总清单 {page}
   collect(params){
     return axios.get(base.collect,{params})
   },

   

/*
   // 撤销汇总  {id}
   cancel(params){
     return axios.get(base.cancel,{params})
   },
*/

   cancel(){
    return axios.get(base.cancel)
  },


   // 订单详情 {id}  params ,{params}
   detail(){
     return axios.get(base.detail)
   },

  
   // 登录   params = { user:'',pwd:'' }
   login(params){
     return axios.post(base.login,params)
   },

   //  权限   params = { token="" }
   permission(params){
     return axios.get(base.permission,{params})
   }

}

// 单个导出 
export function permission(params){
  return axios.get(base.permission,{params})
}

export default api;
//export function getGoodsList(){
//} 